<template>
  <div class="box">
    <div class="left">
<!--      <div class="texsum">5307</div>-->
      <div class="ljyj">累计预警</div>
    </div>
    <div class="right">
      <div class="jl-box">
        <img src="../imgs/jinl.png"/>
        <div class="texsum">{{ sumData.day }}</div>
        <div>今日</div>
      </div>
      <div class="jl-box">
        <img src="../imgs/jinl.png"/>
        <div class="texsum" style="color: #F28D49">{{ sumData.month }}</div>
        <div>本月</div>
      </div>
    </div>

  </div>
</template>

<script lang="ts">
import useView from "@/hooks/useView";
import {defineComponent, reactive, toRefs} from "vue";
import baseService from "@/service/baseService";

export default defineComponent({
  name: "RealTimeTree",
  setup() {
    const state = reactive({
      sumData: {
        day: 0,
        month: 0
      } as any
    });
    return {...useView(state), ...toRefs(state)};
  },
  created() {
    this.getWarningSum();
  },
  methods: {
    // 获取信息
    getWarningSum() {
      baseService.get(`/homeData/getWarningSum`).then((res) => {
        if (res.code !== 0) {
          return this.$message.error(res.msg);
        }
        this.sumData = res.data;
      });
    }
  }
});
</script>

<style lang="scss" scoped>
.texsum {
  font-family: Source Han Sans CN;
  font-weight: 500;
  font-size: 12px;
  color: #FFE56A;
  padding-left: 6px;
}

.ljyj{
  font-family: Source Han Sans CN;
  font-weight: 400;
  font-size: 14px;
  color: #CEFAFB;
}

.box {
  color: #bed4e2;
  width: 100%;
  padding: 25px 8px 10px 8px;
  overflow: hidden;
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  //justify-content: space-around;
  .left {
    height: 90px;
    width: 125px;
    padding: 16px 30px 20px 30px;
    text-align: center;
    background-image: url(../imgs/alarm_total_alls.png);
    background-position: bottom;
    background-repeat: no-repeat;
    background-size: 100% 86px;
  }

  .right{
    flex: 1;
    padding: 0 10px;
  }

  .jl-box {
    display: flex;
    align-items: center;
    margin-top: 10px;
    justify-content: space-between;

    img {
      width:22px;
      height: 22px;
      margin-right: 6px;
    }
  }
}
</style>
